-- @owner: lvlintao
-- @date: 2025-11-18
-- @testpoint: D兼容性-在C库内测试该特性核心用例，部分测试点合理报错
@connect PrimaryDbCmode;
--step1 nvarchar(max)功能测试;expect:报错
drop table if exists case0017;
create table case0017(col1 int, col2 nvarchar(max), col3 nvarchar(50), col4 nvarchar, col5 nvarchar2(max), col6 nvarchar2(50), col7 nvarchar2);
insert into case0017 values(1, 'abcd', 'abcd', 'a', 'abcd','abcd','a');
select * from case0017;
drop table if exists case0017;
--step1 <>操作符测试;expect:报错
select 2< >3;
--step3 drop trigger不加表名;expect:报错
drop table if exists case0017;
drop table if exists case0017_2;
create table  case0017(id int, name char(30));
create table case0017_2(id int, foodtype varchar(32), remark varchar(32), time_flag timestamp);
create or replace function insert_fun1 returns trigger as 
$d$
begin
  insert into case0017_2 (id, foodtype, remark, time_flag) values(1, 'cake','healthy', now());
  return new;
end;
$d$ language plpgsql;
/
create trigger test_trigger1 after insert on case0017
for each row
execute procedure insert_fun1();/
select tgname from pg_trigger;
select count(*) from case0017_2;
insert into  case0017(id, name) values(1, 'child');
select * from  case0017;
select count(*) from case0017_2;

drop trigger if exists test_trigger1 cascade;
drop trigger if exists test_trigger1 on case0017;
select tgname from pg_trigger;
drop function insert_fun1;
drop table if exists case0017;
drop table if exists case0017_2;
--step4 支持newid()函数;expect:报错
select newid();
